﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LoaiLinhKien_Entry.ascx.cs" Inherits="cbmobile.UserControl.LoaiLinhKien_Entry1" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>

<script type="text/javascript">
    function validateChooseDropList(oSrc, args) {
        args.IsValid = (args.Value != '0');
    }
</script>
<div class="sb-box">
    <div class="header">
        <h3>
            Thông tin Loại linh kiện</h3>
    </div>
    <div class=" clear">
    </div>
    <div class="bcont">
        <div class="selection">

            <asp:FormView ID="frmBlogCate" CellPadding="0" runat="server" DataSourceID="ObjectDataSource1"
                onupdating="frmBlogCate_ItemUpdating" OnItemInserted="frmBlogCate_ItemInserted"
                OnItemInserting="frmBlogCate_ItemInserting" OnItemDeleted="frmBlogCate_ItemDeleted"
                OnDataBound="frmBlogCate_DataBound">
                <ItemTemplate>
                    <table border="0">
                        <tr>
                            <td class="setup01">
                                Mã loại linh kiện
                            </td>
                            <td class="setup02">
                                <asp:Label ID="lblName" runat="server" Text='<%# Bind("Ma_LoaiLinhKien") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td class="setup01">
                                Tên loại linh kiện
                            </td>
                            <td class="setup02">
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Ten_LoaiLinhKien") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td class="setup01">
                                Thứ tự
                            </td>
                            <td class="setup02">
                                <asp:Label ID="lblSort_Order" runat="server" Text='<%# Bind("ThuTu") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td class="setup01">
                                Trạng thái
                            </td>
                            <td class="setup02">
                                <asp:Label ID="lblStatus" runat="server" Text='<%# StatusName(Eval("TrangThai")) %>' />
                            </td>
                        </tr>
                        <tr>
                            <td class="C pdT10" colspan="2">
                                <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                                    Text="Edit" CssClass="button"><span>Edit</span></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="DeleteButton" OnClientClick='return confirm("Do you want delete this item?");'
                                    runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" CssClass="button"><span>Delete</span></asp:LinkButton>
                                &nbsp; <a href='<%=this.ListLink %>' class="button"><span>Cancel</span></a>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
                <EditItemTemplate>
                    <table border="0">
                        <tr>
                            <td class="setup01">
                                Tên loại linh kiện
                            </td>
                            <td class="setup02">
                                <asp:TextBox ID="txtName" CssClass="inputtext medium" runat="server" Text='<%# Bind("Ten_LoaiLinhKien") %>' />
                                <asp:RequiredFieldValidator ID="rfilName" runat="server" ErrorMessage=" Tên không được để trống !" ForeColor="red" ControlToValidate="txtName" ValidationGroup="CheckCategory"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="setup01">
                                Thứ tự
                            </td>
                            <td class="setup02">
                                <asp:TextBox ID="txtSort_Order" CssClass="inputtext medium" runat="server" Text='<%# Bind("ThuTu") %>' />
                                <asp:RequiredFieldValidator ID="rfilSort_Order" runat="server" ErrorMessage=" không được để trống !" ForeColor="red" ControlToValidate="txtSort_Order" ValidationGroup="CheckCategory"></asp:RequiredFieldValidator>
                                <%--<asp:FilteredTextBoxExtender ID="ftbeSO" FilterType="Numbers" TargetControlID="txtSort_Order"
                                    runat="server">
                                </asp:FilteredTextBoxExtender>--%>
                            </td>
                        </tr>
                        <tr>
                            <td class="setup01">
                                Trạng thái
                            </td>
                            <td class="setup02">
                               <asp:DropDownList ID="ddlStatus" runat="server" >
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="C pdT10" colspan="2">
                                <asp:LinkButton ID="EditButton" ValidationGroup="CheckCategory" runat="server" CausesValidation="True"
                                    CommandName="Update" Text="Edit" CssClass="button"><span>Update</span></asp:LinkButton>
                                &nbsp;&nbsp;&nbsp;<a href='<%=this.ListLink %>' class="button"><span>Cancel</span></a>
                            </td>
                        </tr>
                    </table>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <table border="0">
                        <table border="0">
                        <tr>
                            <td class="setup01">
                                Tên loại linh kiện
                            </td>
                            <td class="setup02">
                                <asp:Textbox ID="txtTen" runat="server" Text='<%# Bind("Ten_LoaiLinhKien") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td class="setup01">
                                Thứ tự
                            </td>
                            <td class="setup02">
                                <asp:Textbox ID="lblSort_Order" runat="server" Text='<%# Bind("ThuTu") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td class="setup01">
                                Trạng thái
                            </td>
                            <td class="setup02">
                                <asp:DropDownList ID="ddlStatus" runat="server" >
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="C pdT10" colspan="2">
                                <asp:LinkButton ID="EditButton" runat="server" ValidationGroup="CheckCategory" CausesValidation="True"
                                    CommandName="Insert" Text="Edit" CssClass="button"><span>Insert</span></asp:LinkButton>
                                &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Cancel"
                                    Text="Cancel" CssClass="button"><span>Delete</span></asp:LinkButton>
                                &nbsp; <a href="<%=this.ListLink %>" class="button"><span>Cancel</span></a>
                            </td>
                        </tr>
                    </table>
                </InsertItemTemplate>
            </asp:FormView>
        </div>
    </div>
</div>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
    DeleteMethod="Delete" InsertMethod="Create" 
    SelectMethod="Get_LoaiLinhKien_By_ID" TypeName="cbmobile.BLC.BLC_LoaiLinhKien" 
    UpdateMethod="Update" oninserting="ObjectDataSource1_Inserting" 
    onupdating="ObjectDataSource1_Updating">
    <DeleteParameters>
        <asp:QueryStringParameter DefaultValue="0" Name="Ma_LoaiLinhKien" 
            QueryStringField="Ma_LoaiLinhKien" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="Parent_ID" Type="Int32" />
        <asp:Parameter Name="Ten_LoaiLinhKien" Type="String" />
        <asp:Parameter Name="ThuTu" Type="Int32" />
        <asp:Parameter Name="TrangThai" Type="Int32" />
    </InsertParameters>
    <SelectParameters>
        <asp:QueryStringParameter DefaultValue="0" Name="Ma_LoaiLinhKien" 
            QueryStringField="Ma_LoaiLinhKien" Type="Int32" />
    </SelectParameters>
    <UpdateParameters>
        <asp:QueryStringParameter DefaultValue="0" Name="Ma_LoaiLinhKien" 
            QueryStringField="Ma_LoaiLinhKien" Type="Int32" />
        <asp:Parameter Name="Ten_LoaiLinhKien" Type="String" />
        <asp:Parameter Name="ThuTu" Type="Int32" />
        <asp:Parameter Name="TrangThai" Type="Int32" />
    </UpdateParameters>
</asp:ObjectDataSource>
